more exhaustive list includes: Interactive JavaScript data visualizations based on htmlwidgets; R gra
---
title: "flexdashboard: Easy interactive dashboards for R"
output:
flexdashboard::flex_dashboard:
orientation: rows
source_code: embed
social: menu
---
# Intro {.sidebar}
You can use flexdashboard to publish groups of related data visualizations as a dashboard. A flexdashboard can either be static (a standard web page) or dynamic (a Shiny interactive document). A wide variety of components can be included in flexdashboard layouts, including:
```{r include = FALSE}
knitr::opts_chunk$set(cache = TRUE)
library(dplyr)
library(highcharter)
library(viridisLite)
library(ggplot2)
data(unemployment)
data(uscountygeojson)
thm <-
hc_theme(
colors = c("#1a6ecc", "#434348", "#90ed7d"),
chart = list(
backgroundColor = "transparent",
style = list(fontFamily = "Source Sans Pro")
),
xAxis = list(
gridLineWidth = 1
)
)
data("USArrests", package = "datasets")
data("usgeojson")
USArrests <- USArrests %>%
mutate(state = rownames(.))
n <- 4
colstops <- data.frame(
q = 0:n/n,
c = substring(viridis(n + 1), 0, 7)) %>%
highcharter::list_parse2()
```
# PG1 {data-icon="fa-list"}
## Col1 {data-height=350}
### ggplot2 Plots
```{r}
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
geom_smooth()
```
## Col2 {data-height=650 .tabset .tabset-fade}
### htmlwidgets {data-width=300}
```{r}
highchart() %>%
hc_add_series_map(usgeojson, USArrests, name = "Sales",
value = "Murder", joinBy = c("woename", "state"),
dataLabels = list(enabled = TRUE,
format = '{point.properties.postalcode}')) %>%
hc_colorAxis(stops = colstops) %>%
hc_legend(valueDecimals = 0, valueSuffix = "%") %>%
hc_mapNavigation(enabled = TRUE) %>%
hc_add_theme(thm)
```
### tables htmlwidgets {data-width=700}
```{r}
library(DT)
datatable(iris, options = list(pageLength = 10))
```
# PG2 {data-icon="fa-map"}
## Col1
### base plots
```{r}
plot(mpg$displ, mpg$hwy)
```
> more exhaustive list includes: Interactive JavaScript data visualizations based on htmlwidgets; R gra